#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <string.h>
#include <assert.h>

char* My_strncpy(char* dest, char* src, size_t num)
{
	assert(dest && src);
	char* ret = dest;
	while (num--)
	{
		*dest++ = *src++;
	}
	return ret;
}

int main()
{
	char str1[20] = "hello world!";
	char str2[20] = { 0 };
	My_strncpy(str2, str1, 10);
	puts(str2);
	return 0;
}